package com.chookss.home.audit.adapter;

import android.content.Context;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.chookss.R;
import com.chookss.home.entity.PaySlipEntity;

import java.util.List;

import io.reactivex.annotations.Nullable;

public class PaySlipListAdapter extends BaseQuickAdapter<PaySlipEntity, BaseViewHolder> {
   private Context context;
    public PaySlipListAdapter(int layoutResId, Context context, @Nullable List<PaySlipEntity> data) {
        super(layoutResId, data);
        this.context=context;
    }

    @Override
    protected void convert(BaseViewHolder helper, PaySlipEntity item) {
        TextView tvTitle = helper.getView(R.id.tvTitle);
        RecyclerView rv = helper.getView(R.id.rvView);
        tvTitle.setText(item.getParentTitleName());
        rv.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
        PaySlipAdapter adapter = new PaySlipAdapter(R.layout.item_pay_slip,context,item.getTitleInfo());
        rv.setAdapter(adapter);
    }
}
